<?php
/**
 * Created by PhpStorm.
 * User: Jerry
 * Date: 2017/1/16
 * Time: 13:54
 */

namespace SDXApi\Model;


use Think\Model;

/**
 * Class TouchNavModel
 * @package SDXApi\Model
 */
class TouchNavModel extends Model
{
    /**
     * 返回设置显示的导航数据
     * @author Jerry
     * @param bool $isTest
     * @return mixed
     */
	public function get_touch_nav_list($isTest = false)
	{
		$where = array(
			'ifshow'	=>	1,
            'is_test'   =>  0,
		);

		if ($isTest) {
		    unset($where['is_test']);
        }

		$field = 'ctype, cid, name, vieworder, opennew, url, pic, type, is_promotion';

		return $this->field($field)->where($where)->order('is_promotion desc, vieworder desc')->select();
	}
}